/*  1:   */ package org.intellij.images.editor.actions;
/*  2:   */ 
/*  3:   */

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.project.DumbAware;
import org.intellij.images.editor.ImageEditor;
import org.intellij.images.editor.actionSystem.ImageEditorActionUtil;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */ 
/* 10:   */ public final class ToggleGridAction
/* 11:   */   extends ToggleAction
/* 12:   */   implements DumbAware
/* 13:   */ {
/* 14:   */   public boolean isSelected(AnActionEvent paramAnActionEvent)
/* 15:   */   {
/* 16:32 */     ImageEditor localImageEditor = ImageEditorActionUtil.getValidEditor(paramAnActionEvent);
/* 17:33 */     return (localImageEditor != null) && (localImageEditor.isGridVisible());
/* 18:   */   }
/* 19:   */   
/* 20:   */   public void setSelected(AnActionEvent paramAnActionEvent, boolean paramBoolean)
/* 21:   */   {
/* 22:37 */     ImageEditor localImageEditor = ImageEditorActionUtil.getValidEditor(paramAnActionEvent);
/* 23:38 */     if (localImageEditor != null) {
/* 24:39 */       localImageEditor.setGridVisible(paramBoolean);
/* 25:   */     }
/* 26:   */   }
/* 27:   */   
/* 28:   */   public void update(AnActionEvent paramAnActionEvent)
/* 29:   */   {
/* 30:44 */     super.update(paramAnActionEvent);
/* 31:45 */     ImageEditorActionUtil.setEnabled(paramAnActionEvent);
/* 32:46 */     paramAnActionEvent.getPresentation().setText(isSelected(paramAnActionEvent) ? "Hide Grid" : "Show Grid");
/* 33:   */   }
/* 34:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.images.editor.actions.ToggleGridAction

 * JD-Core Version:    0.7.0.1

 */